package ankang.day140104;

import java.util.Scanner;

public class Test10 {
    public static void main(String[] args) {
        //输入一个数字，打印对应的星期单词。
        Scanner sc=new Scanner(System.in);
        /*System.out.println("请输入 1-7 之间的整数，表示星期：");
        int day=sc.nextInt();
        switch (day){
            case 1:System.out.println("Sunday"); break;
            case 2: System.out.println("Monday");  break;
            case 3:System.out.println("Tuesday");  break;
            case 4:  System.out.println("Wednesday");break;
            case 5:  System.out.println("Thursday"); break;
            case 6: System.out.println("Friday"); break;
            case 7: System.out.println("Saturday"); break;
            default:  System.out.println("输入有误"); break;
        }*/

        /*for (int i = 1; i <= 100; i++) {
            if(i>=60){
                break;
            }
            System.out.println(i);
        }*/


        Q:while(true){
            System.out.println("请输入第一个整数");
            double n1= sc.nextDouble();

            System.out.println("请输入一个运算符");
            String operator=sc.next();

            System.out.println("请输入第二个整数");
            double n2= sc.nextDouble();
            switch (operator) {
                case "+": System.out.println(n1+n2); break;
                case "-": System.out.println(n1-n2); break;
                case "*": System.out.println(n1*n2); break;
                case "/": System.out.println( n2 != 0?   n1/n2 : "除数不能为0"  ); break;
                case "%": System.out.println(n1%n2); break;
                default: System.out.println("输入有误");break Q;
            }
        }





    }
}











